package com.hanamaki.struct;

import java.util.Scanner;

public class IfDemo02 {

    public static void main(String[] args) {

        int sum = 10;
        int h = 6;
        if (h > 5) {
            System.out.println("退货");
        } else {
            System.out.println("吃");
        }

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数字a");
        int a = scanner.nextInt();
        System.out.println("请输入数字b");
        int b = scanner.nextInt();

        if (a % b == 0 || a + b > 1000) {
            System.out.println(a);
        } else {
            System.out.println(b);
        }

//         三元运算符   三目运算符
        double result = ((a % b == 0) || (a + b > 1000)) ? a : b;

        System.out.println(result);

    }
}
